<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>


        <div class="table-box tablenes">
            <div class="title">工程信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程名称</td><td id="enginname" class="tv colorlan"></td><td class="tt">工程编号</td><td id="engin_number" class="tv"></td></tr>
                <tr><td class="tt">业务归属</td><td id="engin_gui_unit_name" class="tv"></td><td class="tt">工程管理文件汇编</td><td id="engin_neiname" class="tv colorlan"></td></tr>
                <tr><td class="tt">工程负责人</td><td id="engin_gofuer" class="tv"></td><td class="tt">负责人联系电话</td><td id="engin_gofutel" class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_gofuerxianginfo">工程负责人所属工程回款资金池（单位：元）</script>
            <div class="tableShow">
                <table id="datalist_gofuerxianginfo" lay-filter="datalist_gofuerxianginfo"></table>
            </div>
        </div>

        <div class="table-box tablenes">
            <div class="title">工程负责人预收款资金池（单位：元）</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">累计预收款</td><td id="hougongyumoney" class="tv"></td><td class="tt">累计已收取</td><td id="hougongyukoufee" class="tv"></td></tr>
                <tr><td class="tt">累计工程付款</td><td id="hougongzhimoneyqugoer" class="tv"></td><td class="tt">进项抵扣退税转入</td><td id="hougongshuimoneygoquan" class="tv"></td></tr>
                <tr><td class="tt">预收款可用余额</td><td id="hougongyukeyong" class="tv" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>






        <div class="table-box tablenes">
            <div class="title">本次付款信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">款项摘要</td><td id="zhai" class="tv"></td><td class="tt">本次付款合计(元)</td><td id="money" class="tv"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>


        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">付款明细</script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>


        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_hou_gongzhi_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;

                if(engininfo){
                    $("#enginname").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });
                    $('#engin_number').text(engininfo.number);
                    $('#engin_gui_unit_name').text(engininfo.gui_unit_name);
                    $('#engin_gofuer').text(engininfo.gofuer);
                    $('#engin_gofutel').text(engininfo.gofutel);
                    if(engininfo.neiinfo){
                        $("#engin_neiname").text(engininfo.neiinfo.name).click(function () {
                            openPage('../contract_nei/show.php?id='+engininfo.neiinfo.id);
                        });
                    }

                    $('#hougongyumoney').text(engininfo.gofuerinfo.hougongyumoney);
                    $('#hougongyukoufee').text(engininfo.gofuerinfo.hougongyukoufee);
                    $('#hougongzhimoneyqugoer').text(engininfo.gofuerinfo.hougongzhimoneyqugoer);
                    $('#hougongshuimoneygoquan').text(engininfo.gofuerinfo.hougongshuimoneygoquan);
                    $('#hougongyukeyong').text(engininfo.gofuerinfo.hougongyukeyong);

                    var gofuerxianginfoList = table.render({
                        elem: "#datalist_gofuerxianginfo",data:engininfo.gofuerxianginfo, toolbar: '#toolbarDemo_gofuerxianginfo', page: false
                        ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                        ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text,totalRow: true
                        ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                        , cols: [[
                            {type:'numbers',title:'序号',fixed:'left'}
                            ,{field: 'name', title: '工程名称'}
                            ,{field: 'hougonghuimoney', title: '累计工程回款(元)'}
                            ,{field: 'hougongzhimoneyquben', title: '累计工程付款(元)'}
                            ,{field: 'hougonghuikoufee', title: '累计已收取(元)'}
                            ,{field: 'hougonghuikeyong', title: '工程回款可用余额(元)'}
                        ]]
                        , done: function (res) {
                            soulTable.render(this);
                        }
                    });
                }


                $("#money").text(data.money);
                $("#zhai").text(data.zhai);
                $("#explain").text(data.explain);

                var mytableList = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text,totalRow: true
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',totalRowText: '合计',fixed:'left'}
                        ,{field: 'zhikuanlei_name', title: '款项类型'}
                        ,{field: 'fuer', title: '付款对象'}
                        ,{field: 'gongzhifee', title: '已付款累计(元)'}
                        ,{field: 'piaoshoufee', title: '已收票累计(元)'}
                        ,{field: 'concaimoney', title: '已签合同累计(元)'}
                        ,{field: 'caiid_name', title: '本次支付关联采购合同'}
                        ,{field: 'money', title: '本次付款金额(元)'}
                        ,{field: 'moneyshuo', title: '资金渠道及金额'}
                        ,{field: 'incdaotype_name', title: '支付方式'}
                        ,{field: 'banknum', title: '账户账号'}
                        ,{field: 'bankname', title: '开户行'}
                        ,{field: 'explain', title: '款项说明'}
                        ,{field: 'difee', title: '本次支付占用进项票金额(元)'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });



                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('hou_gongzhi', param_id);
    });



</script>
</body>
</html>




